package com.neu;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ConfigurableApplicationContext;

import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Hello world!
 *
 */

@SpringBootApplication()
@MapperScan(basePackages = "com.neu.dao")
public class App 
//外置tomcat环境的配置需要这个类的configure方法来指定初始化资源
//extends SpringBootServletInitializer 
{
    public static void main( String[] args )
    {
    	ConfigurableApplicationContext context = SpringApplication.run(App.class, args);
        System.out.println( "该服务的名称是:{}"+context.getEnvironment().getProperty("spring.application.name"));
        System.out.println("该服务器的启动端口是:{}"+context.getEnvironment().getProperty("server.port"));
    }
    
//    @Override
//    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
//        return builder.sources(App.class);
//    }
}